package com.fangwaii.core.socket.agreement;

/**
 * @author lxc18
 * @date 2024/12/6 19:36
 * @description GatewayResult
 */
public class GatewayResult {
    private String code;
    private String message;

    private Object data;

    public GatewayResult(String code, String message, Object data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }
    public String getCode() {
        return code;
    }
    public String getMessage() {
        return message;
    }
    public Object getData() {
        return data;
    }
    public static GatewayResult gatewaySucess(Object data){
        AgreementConstants.ResponseCode responseCode = AgreementConstants.ResponseCode._200;
        return new GatewayResult(responseCode.getCode(),responseCode.getInfo(),data);
    }
    public static GatewayResult gatewayFail(String code, String info, Object data){
        return new GatewayResult(code,info,data);
    }
    public static GatewayResult gatewayFail(String code, String info){
        return new GatewayResult(code,info,null);
    }

}
